package com.gkwave.action.service;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.gkwave.module.bean.FoodMenuBean;
import com.gkwave.module.dao.FoodMenuDAO;

public class FoodMenuBranchListService extends BaseService{

	/**
	 * 
	 */
	private static final long serialVersionUID = 7506434653398515441L;

	@Override
	public void procesRequest(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		String idLocation = request.getParameter("idLocation");
		out = response.getWriter();
		try{
			Integer id_location = Integer.parseInt(idLocation);
			FoodMenuDAO dao = new FoodMenuDAO();
			FoodMenuBean bean = dao.getBranchesByLocation(id_location);
			xmlResponse = bean.marsel(bean, "Branches", "branch");
		}catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
		System.out.println(xmlResponse);
		out.println(xmlResponse);
	}

}
